<#import "../../common/layout.ftl" as l>


<@l.content>

<script>
    var crud = {
        read: "/manage/ship/detail",
        update: '/manage/ship/update',
        del: "/manage/ship/delete"
    };

    var model = [
        {name : 'shipid',type : 'hidden',text : '船舶编号',allowBlank : true,primaryKey : true},
        {name : 'mmsi',type : 'number',text : 'MMSI',allowBlank : false,primaryKey : false},
        {name : 'shipName',type : 'text',text : '船名',allowBlank : false,primaryKey : false},
        {name : 'shipEnName',type : 'text',text : '船舶英文名',allowBlank : false,primaryKey : false},
        {name : 'callSign',type : 'text',text : '船舶呼号',allowBlank : false,primaryKey : false},
        {name : 'nation',type : 'text',text : '国籍',allowBlank : false,primaryKey : false},
        {name : 'shipType',type : 'select',text : '船舶种类',allowBlank : false,primaryKey : false,options : {
            url : "/dict/findByType?type=ship_type",
            displayField : "label",
            valueField : "label"
        }},
        {name : 'tonnage',type : 'number',text : '吨位',allowBlank : false,primaryKey : false},
        {name : 'power',type : 'number',text : '主机功率',value:0,allowBlank : false,primaryKey : false},
        {name : 'shipLength',type : 'number',text : '船舶长度',allowBlank : false,primaryKey : false},
        {name : 'draftAfter',type : 'number',text : '后吃水',allowBlank : false,primaryKey : false},
        {name : 'draftMax',type : 'number',text : '最大吃水',allowBlank : false,primaryKey : false},
        {name : 'draftForward',type : 'number',text : '前吃水',allowBlank : false,primaryKey : false}
    ];
</script>


<form id="pagination-form" method="post">

    <input type="hidden" name="page" value="${pageInfo.pageNum}">
    <input type="hidden" name="limit" value="${pageInfo.pageSize}">
    <input type="hidden" name="totalPage" value="${pageInfo.pages}">
    <div class="ibox">
        <div class="ibox-title">
            <h3><#if Session['currentMenu']??>${Session['currentMenu'].name}<#else></#if></h3>

            <div class="ibox-tools">
                <a href="#" id="pagination-add">
                    <i class="fa fa-plus"></i>
                    添加
                </a>
                <a id="pagination-edit" href="#">
                    <i class="fa fa-edit"></i>
                    编辑
                </a>

                <a id="pagination-delete" href="#">
                    <i class="fa fa-trash"></i>
                    删除
                </a>

            </div>
        </div>
        <div class="ibox-content">
            <div class="input-group search-content">
                <input type="text" name="shipName" value="<#if param.shipName??>${param.shipName}<#else></#if>" class="form-control"> <span class="input-group-btn">
                <input type="submit" class="btn btn-primary" value="搜索">
            </span></div>
            <div>
                <div class="table-responsive">
                    <table class="table table-striped table-hover dataTables-example" >
                        <thead>
                        <tr>
                            <th>&nbsp;</th>
                            <th>船名</th>
                            <th>MMSI</th>
                            <th>船舶英文名</th>
                            <th>船舶呼号</th>
                            <th>国籍</th>
                            <th>船舶种类</th>
                            <th>吨位</th>
                            <th>主机功率</th>
                            <th>船舶长度</th>
                            <th>后吃水</th>
                            <th>最大吃水</th>
                            <th>前吃水</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody>
                            <#list pageInfo.list as report>
                            <tr>
                                <td><input type="checkbox" class="i-checks" value="<#if report.shipid??>${report.shipid}<#else></#if>"></td>
                                <td><a href="#" onclick="pagination.editItem('<#if report.shipid??>${report.shipid}<#else></#if>')"><#if report.shipName??>${report.shipName}<#else></#if></a></td>
                                <td><#if report.mmsi??>${report.mmsi}<#else></#if></td>
                                <td><#if report.shipEnName??>${report.shipEnName}<#else></#if></td>
                                <td><#if report.callSign??>${report.callSign}<#else></#if></td>
                                <td><#if report.nation??>${report.nation}<#else></#if></td>
                                <td><#if report.shipType??>${report.shipType}<#else></#if></td>
                                <td><#if report.tonnage??>${report.tonnage}<#else></#if></td>
                                <td><#if report.power??>${report.power}<#else></#if></td>
                                <td><#if report.shipLength??>${report.shipLength}<#else></#if></td>
                                <td><#if report.draftAfter??>${report.draftAfter}<#else></#if></td>
                                <td><#if report.draftMax??>${report.draftMax}<#else></#if></td>
                                <td><#if report.draftForward??>${report.draftForward}<#else></#if></td>
                                <td><a onclick="FormUtils('/manage/ship/communication/list',{shipid:<#if report.shipid??>'${report.shipid}<#else></#if>'})" href="#">通联信息</a>&nbsp;|&nbsp;<a onclick="FormUtils('/manage/ship/manning/list',{shipid:<#if report.shipid??>'${report.shipid}<#else></#if>'})" href="#">配员信息</a></td>
                            </tr>
                            </#list>
                        </tbody>


                    </table>
                </div>
                <div class="pagination-content">
                    <div id="pagination" class="pagination">
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>


</@l.content>

<script src="/pagination/js/pagination.js"></script>
